package xerr

//成功返回
const OK uint32 = 200

/**(前3位代表业务,后三位代表具体功能)**/

//全局错误码
const SERVER_COMMON_ERROR uint32 = 100001
const REUQEST_PARAM_ERROR uint32 = 100002
const TOKEN_EXPIRE_ERROR uint32 = 100003
const TOKEN_GENERATE_ERROR uint32 = 100004
const DB_ERROR uint32 = 100005
const DB_UPDATE_AFFECTED_ZERO_ERROR uint32 = 100006

const SMS_SEND_ERR = 100008
const SMS_AUTH_ERR = 100009
const PARAMETER_ERR = 100010
const DB_NOT_FOUND_ERR = 100011
const REDIS_SET_ERR = 100007
const REDIS_NOT_FOUND = 100012
const REDIS_ERROR = 100015
const DB_ALREADY_EXIST = 100013
const DB_NOT_EXIST = 100014
const PW_ERROR = 100015
const USER_NOT_FOUND = 100016
const USER_NOT_DEL_SELF = 100017

func init() {
	message[OK] = "SUCCESS"
	message[SERVER_COMMON_ERROR] = "服务器开小差啦,稍后再来试一试"
	message[REUQEST_PARAM_ERROR] = "参数错误"
	message[TOKEN_EXPIRE_ERROR] = "token失效，请重新登陆"
	message[TOKEN_GENERATE_ERROR] = "生成token失败"
	message[DB_ERROR] = "数据库繁忙,请稍后再试"
	message[DB_UPDATE_AFFECTED_ZERO_ERROR] = "更新数据影响行数为0"
	message[REDIS_SET_ERR] = "缓存存储出错"
	message[SMS_SEND_ERR] = "发送短信验证码错误"
	message[SMS_AUTH_ERR] = "短信验证错误"
	message[PARAMETER_ERR] = "参数错误"
	message[DB_NOT_FOUND_ERR] = "查询数据不存在"
	message[REDIS_NOT_FOUND] = "Redis查询数据不存在"
	message[DB_ALREADY_EXIST] = "数据已存在"
	message[DB_NOT_EXIST] = "数据不存在"
	message[REDIS_ERROR] = "Redis错误"
	message[PW_ERROR] = "密码错误"
	message[USER_NOT_FOUND] = "用户不存在"
	message[USER_NOT_DEL_SELF] = "不能删除自己"
}
